class CreateAssignments < ActiveRecord::Migration
  def self.up
    create_table :assignments do |t|
      t.column  :job_id,   :integer,   :null => false
      t.column  :user_id,  :integer,   :null => false
    end
    
    execute  "alter table assignments add constraint fk_assignments_jobs 
             foreign key (job_id) references jobs(id)"
             
    execute "alter table assignments add constraint fk_assignments_users 
             foreign key (user_id) references users(id)"
    
  end

  def self.down
    drop_table :assignments
  end
end
